﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Accounting.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Accounting.Accounting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="mainWarp">
        <div class="pageBody">
            <form id="form1" runat="server" style="text-align: center; vertical-align: middle;
            padding-top: 100px;">
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
            </asp:ScriptManager>
            <asp:HiddenField ID="hidHaveMonth" runat="server" />
            <asp:HiddenField ID="hidYear" runat="server" />
            <asp:HiddenField ID="hidMonth" runat="server" />
            <asp:HiddenField ID="hidHaveData" runat="server" />
            <div style="text-align: left; vertical-align: middle; width: 680px; border: 2px solid #c3dce5;
                padding: 50px 50px 50px 50px;">
                <div id="divNoMonth" style="display: none;">
                    <label>没有激活核算月, 请进入"流程管理"页面设置一个当前核算月.</label>
                </div>
                <div id="divMain">
                    <asp:Label ID="labMsg1" runat="server" Text=""></asp:Label>
                    <input type="button" id="btnAccounting" class="commonBut" onclick="AccountingClick();"
                        value="审核" />
                    <br />
                    <br />
                    <div id="divLoader" style="display: none;">
                        <img src="../App_Themes/ui-lightness/images/ajax-loader.gif"></img>正在进行计算, 请不要关闭或刷新本页面.</div>
                </div>
            </div>
            </form>
        </div>
    </div>
</body>
<script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="../Scripts/common.js"></script>
<script type="text/javascript" src="../Scripts/Util.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        if ($("#<%=hidHaveMonth.ClientID %>").val() == "0") {
            $("#divNoMonth").css("display", "block");
            $("#divMain").css("display", "none");
        }
        if ($("#hidHaveData").val() == "0") {
            $("#btnAccounting").css("display", "none");
        }
    });

    // 审核按钮点击
    function AccountingClick() {
        showConfirmBox("提示", "数据被核算后, 将不能被修改. 确定要核算当前指定月份的数据吗?", Accounting);
    }

    // 审核
    function Accounting() {
        $("#divLoader").css("display", "block");
        PageMethods.AccountingMoney(Number($("#hidYear").val()), Number($("#hidMonth").val()),
            function (succ) {
                $("#divLoader").css("display", "none");
                if (succ == null || succ.length < 1)
                    showMassgeBox("提示", "审核成功", 1);
                else
                    showMassgeBox("提示", succ, 1);
                $(document).load();
            },
            function (err) {
                $("#divLoader").css("display", "none");
                if (err == null || err.length < 1)
                    showMassgeBox("提示", "审核失败", 1);
                else
                    showMassgeBox("提示", err, 1);
            }
        );
    }

</script>
</html>
